package com.sf.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.sf.common.R;
import com.sf.entity.Good;
import com.sf.service.GoodService;

/**
 * 请求控制器
 * @author swcks
 *
 */
@RestController
public class GoodController {
	@Autowired private GoodService goodService;
	
	@RequestMapping(value="good/{id}",method=RequestMethod.GET)
	public R goodInfo(@PathVariable("id") Integer id) {
		Good good = goodService.query(id);
		return R.ok().put("good", good);
	}
}
